import { http } from '@/utils/http/axios';
import axios from 'axios';

/**
 * @description: 获取用户设备组展示数据
 */
export function getTableList(params) {
  console.log('getTableListparams', params);
  return http.request({
    url: '/equipment/equipment_group',
    method: 'get',
    params: params,
  });
}

/**
 * @description: 获取项目信息下拉框数据(目前是共用的一个路由)
 */
export function getProjcetOptions(params) {
  console.log('getProjcetOptionsparams', params);
  return http.request({
    url: '/project/projectOptions',
    method: 'GET',
    params: params,
  });
}

/**
 * @description: 批量删除选中的数据
 */
export function delEquipmentGroup(params) {
  console.log('batchdel param:', params);
  return http.request({
    url: '/equipment/del_equipment_group',
    method: 'POST',
    data: params,
  });
}

/**
 * @description: 创建新设备组
 */
export function addEquipmentGroup(params) {
  return http.request({
    url: '/equipment/add_equipmentGroup',
    method: 'POST',
    params,
  });
}

/**
 * @description: edit初始化
 */
export function getEditInit(params) {
  return http.request({
    url: '/equipment/init_equipmentGroup',
    method: 'GET',
    params: params,
  });
}

/**
 * @description: 更新设备组
 */
export function updateEquipmentGroup(params) {
  return http.request({
    url: '/equipment/update_equipmentGroup',
    method: 'POST',
    params,
  });
}
